Chart Types

Area
Bar
BoxPlot
Donut
Dot
HeatMap
Histogram
Horizon
Line
Scatter
Step
TimeSeries

Run ALL THE EXAMPLES

Pandas and bokeh are "just good friends"

Pandas is AWESOME.

But, has a steep learning curve.

If you're a djangocat, the only thing you REALLY need to know

DataFrame.from_records(ValuesQuerySet)

Embedding in your website

  • get rid of the default stylesheet
  • the out of the box embed functions may not give you enough flexibility
  • build your own templates from the _templates directory
  • how to embed

In [5]:
class BokehScriptComponents(object):
    def __init__(self, plot_object, elementid=None):
        if not elementid:
            elementid = str(uuid.uuid4())
        self.elementid = elementid
        self.modelid = plot_object.ref["id"]
        self.modeltype = plot_object.ref["type"]
        self.all_models = serialize_json(plot_object.dump())

Steal & customize the embed templates

var modelid = "{{ figure.modelid }}";
var modeltype = "{{ figure.modeltype }}";
var elementid = "{{ figure.elementid }}";
Bokeh.logger.info("start plotting " + elementid);
var all_models = {{ figure.all_models|safe }};
Bokeh.load_models(all_models);
var model = Bokeh.Collections(modeltype).get(modelid);
var view = new model.default_view({model: model, el: '#{{ figure.elementid }}'});
Bokeh.index[modelid] = view

Resize

Bokeh.Collections('Plot').get("{{ figure.modelid }}").set('plot_width', plot_width);
Bokeh.Collections('Plot').get("{{ figure.modelid }}").set('plot_height', plot_height);

Rolling with the server

  • principle is simple - listen for a change, change the data, push the update

  • seperating the plot server and the client

  • need a "blueprint" of the things you want to make / respond to

  • keep alive ping on heroku

Questions

  • Top 3 reasons / Top 3 use cases to use bokeh over d3js (other than python > js)
  • Can I mention that the 4-yr grant - so not a flash in the pan
  • I want to mention the actions / plugins interface & a timeline
  • Session / Doc - bit challenging - plans for server